<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="vue.global.js"></script>
</head>
<body>
<div id = 'app'></div>
<script>
    let data = {
        message: '张三'
    }

    //代理对象监控值的变化再推送给节点
    data = new Proxy(data, {
        set(target , key, value){
            console.log('set')
            app.innerHTML = value
        },
        get(target){
            console.log('get')
            return target.message
        }
    })

    app.innerHTML = data.message;

    setTimeout(()=>{
        //改变数据时set触发
        data.message = '李四'
    },2000)
</script>
</body>
</html>